/**
 * Includes default message box styles.
 *
 * @member Ext.MessageBox
 */
@mixin sencha-msgbox {
  .x-msgbox {
    min-width: 15em;
    max-width: 20em;
    max-height: 90%;
    margin: .5em;
    @include box-shadow(rgba(#000, .4) 0 .1em .5em);
    @if $include-border-radius { @include border-radius($panel-border-radius); }
    border: .15em solid $base-color;

    // to hide content that is too large (vertically)
    .x-docking-vertical {
      overflow: hidden;
    }

    //icons
    .x-icon {
      margin: 0 0.8em 0 0.5em;
      background: #fff;
      -webkit-mask-size: 100%;
    }

    .x-msgbox-info {
      -webkit-mask-image: theme_image('default', "pictos/info.png");
    }

    .x-msgbox-warning {
      -webkit-mask-image: theme_image('default', "pictos/warning_black.png");
    }

    .x-msgbox-question {
      -webkit-mask-image: theme_image('default', "pictos/help.png");
    }

    .x-msgbox-error {
      -webkit-mask-image: theme_image('default', "pictos/minus_black2.png");
    }

    .x-title {
      font-size: .9em;
      line-height: 1.4em;
    }

    .x-body {
      background: transparent !important;
    }

    .x-toolbar {
      background: transparent none;
      @include box-shadow(none);

      &.x-docked-top {
        border-bottom: 0;
        height: 1.3em;
      }

      &.x-docked-bottom {
        border-top: 0;
      }
    }

    .x-field {
      min-height: 2em;
      background: #fff;
      @if $include-border-radius { @include border-radius(.2em); }
    }

    .x-form-field {
      min-height:1.5em;
      padding-right: 0 !important;
      -webkit-appearance: none;
    }

    .x-field-input {
      padding-right: 2.2em;
    }
  }

  .x-msgbox-text {
    text-align: center;
    padding: 6px 0;
    line-height: 1.4em;
  }

  .x-msgbox-buttons {
    padding: 0.4em 0;
    height: auto;

    .x-button {
      min-width: 4.5em;
    }

    .x-button-normal span {
      opacity: .7;
    }
  }

  // TODO: Refactor along with Sheet
  @include msgbox-ui('dark');
}

@mixin msgbox-ui($ui-label) {
  .x-msgbox-#{$ui-label} {
    .x-msgbox-text {
      @include color-by-background($sheet-bg-color, 80%);
      @include bevel-by-background($sheet-bg-color);
    }
    .x-msgbox-input {
      @include background-gradient(lighten($sheet-bg-color, 80%), 'recessed');
      border: .1em solid lighten($sheet-bg-color, 40%);
    }
  }
}
